package com.cheng.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Author: cheng
 * Date: 13-12-26
 * Time: 下午4:41
 */
public class RegexUtil {
    private static final String reg = "/\\*[\\s\\S]*?\\{[\\s\\S]*?\\}\\s*?\\*/";
    private static final String ss = "/*.com-wrapper {\n" +
            "\t\t\twidth: 280px;\n" +
            "}\n" +
            ".com-wrapper .com-pic img {\n" +
            "\t\t\twidth: 240px;\n" +
            "\t\t\theight: 60px;\n" +
            "}*/\n" +
            ".com-wrapper .pic-info {\n" +
            "\t\t\ttext-align: center;\n" +
            "\t\t\tmargin: 2px 0 8px 0;\n" +
            "}\n" +
            "/*.com-inside ul {\n" +
            "\t\t\tmargin-top: 4px;\n" +
            "\t\t\tmargin-right: 10px;\n" +
            "}\n" +
            ".com-inside ul li {\n" +
            "\t\t\tlist-style: inherit;\n" +
            "}*/";

    public static void main(String[] args) {
        Pattern pattern = Pattern.compile(reg);
        System.out.println(reg);
        Matcher matcher = pattern.matcher(ss);
        System.out.println(ss.length());

//        while(matcher.find()){
//            System.out.println(matcher.group());
//            System.out.println(matcher.start());
//            System.out.println(matcher.end());
//        }
        String[] sss = pattern.split(ss);
        for(String s : sss){
            System.out.println(s);
        }
        System.out.println(sss.length);
        System.out.println(matcher.groupCount());

        int ll = 123;
        long i =ll;

    }
}
